// 文件路径: src/main/java/com/chixing/service/impl/ScheduleServiceImpl.java

package com.chixing.service.impl;

import com.chixing.entity.Schedule;
import com.chixing.mapper.ScheduleMapper;
import com.chixing.service.IScheduleService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author liwenjing
 * @since 2025-10-07
 */
@Service
public class ScheduleServiceImpl extends ServiceImpl<ScheduleMapper, Schedule> implements IScheduleService {

    @Override
    public List<Schedule> getAllSchedules() {
        return list();
    }

    @Override
    public Schedule getScheduleById(Integer scheduleId) {
        return getById(scheduleId);
    }

    @Override
    public List<Schedule> getSchedulesByMovieId(Integer movieId) {
        return lambdaQuery().eq(Schedule::getMovieId, movieId).list();
    }


    @Override
    public boolean addSchedule(Schedule schedule) {
        return save(schedule);
    }

    @Override
    public boolean updateSchedule(Schedule schedule) {
        return updateById(schedule);
    }

    @Override
    public boolean deleteSchedule(Integer scheduleId) {
        return removeById(scheduleId);
    }
}

